<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>

  const objFun = () => {
    const obj = {
      foo: 'foo',
      bar: {
        bar: 'bar',
      }
    }
    obj.bar.baz = obj;

    console.log(obj);
  };

  const init = () => {
    objFun();
  };

  init();
</script>
</html>
